<admintpl file="header" />
</head>
<body>
<div class="wrap">
	<ul class="nav nav-tabs">
		<li><a href="{:U('Merchant/index')}">商户列表</a></li>
		<li><a href="{:U('Merchant/add')}">添加商户</a></li>
		<li class="active"><a href="javascript:;">编辑商户</a></li>
	</ul>
	<form method="post" class="form-horizontal js-ajax-form" enctype="multipart/form-data" action="{:U('Merchant/edit_post')}">
		<fieldset>
			<div class="control-group">
				<label class="control-label"><b style="color:red;">* </b> 商户名称</label>
				<div class="controls">
					<input type="text" name="name" value="{$merchant.name}">
				</div>
			</div>
			<div class="control-group">
				<label class="control-label"><b style="color:red;">* </b> 商户logo</label>
				<div class="controls">
					<input type="file" name="logo">
					<input type="hidden" name="logo_url" value="{$merchant.logo}">
					<img src="<php>echo '/'.C('UPLOADPATH').$merchant['logo']</php>" width="100px">
					&nbsp; <b style="color:red">*</b>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label"><b style="color:red;">* </b> 所在区域</label>
				<div class="controls">
					<input type="text" name="area"  value="{$merchant.area}">
				</div>
			</div>
			<div class="control-group">
				<label class="control-label"><b style="color:red;">* </b> 商户类型</label>
				<div class="controls">
					<volist name="type" id="vo">
						<input type="checkbox" name="type_id[]" value="{$vo.id}"
						<php>
							if(in_array($vo['id'],$merchant['type_id'])){
							echo 'checked';
							}
						</php>
						/>&nbsp;{$vo.name}&nbsp;&nbsp;
					</volist>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label"> 简介</label>
				<div class="controls">
					<textarea name="intro" rows="2" cols="20" id="intro" class="inputtext" style="height: 100px; width: 500px;">{$merchant.intro}</textarea>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">{:L('STATUS')}</label>
				<div class="controls">
					<if condition="$merchant.use_flg eq 1">
						<label class="radio inline" for="active_true"><input type="radio" name="use_flg" value="1" checked  />{:L('ENABLED')}</label>
						<label class="radio inline" for="active_false"><input type="radio" name="use_flg" value="0"  >{:L('DISABLED')}</label>
					<else />
						<label class="radio inline" for="active_true"><input type="radio" name="use_flg" value="1" />{:L('ENABLED')}</label>
						<label class="radio inline" for="active_false"><input type="radio" name="use_flg" value="0" checked >{:L('DISABLED')}</label>
					</if>
				</div>
			</div>
		</fieldset>
		<div class="form-actions">
			<input type="hidden" name="id" value="{$merchant.id}">
			<button type="submit" class="btn btn-primary js-ajax-submit" >{:L('EDIT')}</button>
			<a class="btn" href="javascript:history.back(-1);">{:L('BACK')}</a>
		</div>
	</form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
</body>
</html>